package xyz.xtt.user.service;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.IService;

import xyz.xtt.pay.client.response.TblPayOrderDto;
import xyz.xtt.user.entity.TblUserFundAccount;
import xyz.xtt.user.entity.TblUserFundRecord;

/**
 * <p>
 * 用户资金账户余额表 服务类
 * </p>
 *
 * @author dale
 * @since 2025-02-25
 */
public interface ITblUserFundAccountService extends IService<TblUserFundAccount> {

	/**
	 * c2c订单支付成功后记账
	 * 
	 * @param payOrderDto
	 */
	Boolean handleOrderPaySuccess(TblPayOrderDto payOrderDto);

	/**
	 * c2c订单退款成功后修改记账
	 * 
	 * @param payOrderDto
	 */
	void handleOrderRefundSuccess(TblPayOrderDto payOrderDto);

	/**
	 * 获取需要结算的记录
	 * 
	 * @param maxCount
	 * @param lastId
	 * @return
	 */
	List<TblUserFundRecord> getNeedSettleRecords(int maxCount, Long lastId);

	/**
	 * 获取需要结算的记录
	 * 
	 * @param sellerUserId
	 * @param maxCount
	 * @param lastId
	 * @return
	 */
	List<TblUserFundRecord> getNeedSettleRecords(long sellerUserId, int maxCount, Long lastId);

	/**
	 * 执行资金结算
	 * 
	 * @param userFundRecordId
	 * @return
	 */
	boolean updateFundSettled(long userFundRecordId);

	/**
	 * 执行资金结算
	 * 
	 * @param sellerUserId
	 * @return
	 */
	boolean updateSellerFundSettled(long sellerUserId);
}
